//
//  ExpertViewCell.m
//  iBaby365v2
//
//  Created by admin on 14/12/4.
//  Copyright (c) 2014年 suplus. All rights reserved.
//

#import "ExpertViewCell.h"
#import "UIImageView+AFNetworking.h"
#import "SPExpertclass.h"
#import "MyUILabel.h"

@interface ExpertViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UILabel *titleLable;
@property (weak, nonatomic) IBOutlet UILabel *descLable;

@end
@implementation ExpertViewCell

+(instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"spexpert";
    ExpertViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
        cell = [[[NSBundle mainBundle] loadNibNamed:@"ExpertViewCell" owner:nil options:nil] lastObject];
    }
    return cell;
}
-(void)awakeFromNib
{
    self.descLable.numberOfLines = 0;
   
}
-(void)setExpertroom:(SPExpertclass *)expertroom
{
    _expertroom = expertroom;
    NSLog(@">>>>>>%@",expertroom.title);
    self.titleLable.text = expertroom.title;
    self.descLable.text = expertroom.introduction;
    MyUILabel *descView1 = [[MyUILabel alloc] initWithFrame:CGRectMake(self.descLable.frame.origin.x, self.descLable.frame.origin.y, self.descLable.frame.size.width, self.descLable.frame.size.height)];
    descView1.numberOfLines = 0;
    descView1.textAlignment = NSTextAlignmentLeft;
    descView1.backgroundColor = [UIColor whiteColor];
    descView1.textColor = [UIColor grayColor];
    descView1.lineBreakMode = NSLineBreakByWordWrapping;
    descView1.font = [UIFont systemFontOfSize:12];
    [descView1 setVerticalAlignment:VerticalAlignmentTop];
    descView1.text = self.descLable.text;
    self.descLable =descView1;
    [self addSubview:self.descLable];
    [self.iconView setImageWithURL:[NSURL URLWithString:expertroom.photo] placeholderImage:nil];
    
}

@end
